package myMethods;

/**
 * 
 * @author Fredrik Wallenius
 *
 */
public class MyRandom {

	/**
	 * Returns a random integer number in the range of the two given
	 * arguments.
	 * @param lowest
	 * @param highest
	 * @return
	 */
	public static int getInt(int lowest, int highest){
		return (int) (Math.random()*((highest-lowest)+1)) + lowest;
	}
	
	/**
	 * Returns a random double number in the range of the two given
	 * arguments.
	 * @param lowest
	 * @param highest
	 * @return
	 */
	public static double getDouble(double lowest, double highest){
		return (Math.random()*((highest-lowest))) + lowest;
	}
	
	/**
	 * Returns true or false at a 50/50 ratio
	 * @return
	 */
	public static boolean getBoolean(){
		if(Math.random()<=0.5) return false;
		else return true;
	}
	

}